package tech.luoyu.ki.vo;

import java.io.Serializable;
import java.util.HashMap;

public class ReturnResult implements Serializable {
	private static final long serialVersionUID = 1L;
	/**
	 * 返回码，1表示成功，0表示失败
	 */
	private int code;
	/**
	 * 返回消息，可以是错误信息，也可以是其他提示信息
	 */
	private String message;
	/**
	 * 实际的数据返回
	 */
	private HashMap<String, Object> data = new HashMap<String, Object>();

	public ReturnResult() {
	}

	public ReturnResult(int code, String message) {
		this.code = code;
		this.message = message;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public HashMap<String, Object> getData() {
		return data;
	}

	public void setData(HashMap<String, Object> data) {
		this.data = data;
	}

	public void putData(String key, Object value) {
		this.data.put(key, value);
	}

	public Object getData(String key) {
		return this.data.get(key);
	}

	@Override
	public String toString() {
		return "ReturnResult [code=" + code + ", message=" + message + "]";
	}

}
